package com.foreknow.mapping;

import com.foreknow.model.Business;

import java.sql.ResultSet;
import java.sql.SQLException;

public class BusinessMapping implements EntityMapping {
    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Business business=new Business();
        business.setBusinessId(rs.getInt("BUSINESSID"));
        business.setPassword(rs.getString("PASSWORD"));
        business.setBusinessName(rs.getString("BUSINESSNAME"));
        business.setBusinessAddress(rs.getString("BUSINESSADDRESS"));
        business.setBussinessExplain(rs.getString("BUSINESSEXPLAIN"));
        business.setStarPrice(rs.getFloat("STARPRICE"));
        business.setDeliveryPrice(rs.getFloat("DELIVERYPRICE"));
        return business;
    }
}
